<template>
  <div id="earlyStageAchievementOpinion">
    <el-tabs v-model="activeName">
      <el-tab-pane label="区县综合验收基本信息" name="first">
        <el-form
          :model="submitInfo"
          :rules="rulesSubmitInfo"
          ref="submitInfo"
          class="demo-ruleForm"
        >
          <div class="boxItem">
            <div class="boxItem_title">
              <span class="tit">区县综合验收信息</span>
            </div>
            <div class="boxItem_content" style="padding-top:35px;">
              <el-row :gutter="20">
                <el-col :span="8">
                  <div class="boxItem_content_title">
                    <p>筹措资金：</p>
                    <div class="boxItem_content_row_item_input">
                      <el-form-item prop="capital">
                        <el-input
                          v-model="submitInfo.capital"
                          type="number"
                          suffix
                          min="0"
                          placeholder="请输入"
                        ></el-input>
                        <span class="inputEndText">万元</span>
                      </el-form-item>
                    </div>
                  </div>
                </el-col>
                <el-col :span="8">
                  <div class="boxItem_content_title">
                    <p>预付款总金额：</p>
                    <div class="boxItem_content_row_item_input">
                      <el-form-item prop="advancePaymentTotal">
                        <el-input
                          v-model="submitInfo.advancePaymentTotal"
                          type="number"
                          suffix
                          min="0"
                          placeholder="请输入"
                        ></el-input>
                        <span class="inputEndText">万元</span>
                      </el-form-item>
                    </div>
                  </div>
                </el-col>
              </el-row>
            </div>
          </div>
          <div class="boxItem boxItem2">
            <div class="boxItem_title">
              <span class="tit">验收投资信息</span>
            </div>
            <div class="boxItem_content" style="padding-top:35px;">
              <el-row :gutter="20">
                <el-col :span="2">
                  <p class="freeTitle">工程施工费</p>
                </el-col>
                <el-col :span="22">
                  <el-row>
                    <el-col :span="8">
                      <div class="boxItem_content_title">
                        <p>拆除工程费：</p>
                        <div class="boxItem_content_row_item_input">
                          <el-form-item prop="ccgcf">
                            <el-input
                              v-model="submitInfo.ccgcf"
                              type="number"
                              @input="countMoney"
                              suffix
                              min="0"
                              placeholder="请输入"
                            ></el-input>
                            <span class="inputEndText">万元</span>
                          </el-form-item>
                        </div>
                      </div>
                    </el-col>
                    <el-col :span="8">
                      <div class="boxItem_content_title">
                        <p>土地平整工程费：</p>
                        <div class="boxItem_content_row_item_input">
                          <el-form-item prop="tdpzgcf">
                            <el-input
                              v-model="submitInfo.tdpzgcf"
                              type="number"
                              @input="countMoney"
                              suffix
                              min="0"
                              placeholder="请输入"
                            ></el-input>

                            <span class="inputEndText">万元</span>
                          </el-form-item>
                        </div>
                      </div>
                    </el-col>
                    <el-col :span="8">
                      <div class="boxItem_content_title">
                        <p>农田水利工程费：</p>
                        <div class="boxItem_content_row_item_input">
                          <el-form-item prop="ntslgcf">
                            <el-input
                              v-model="submitInfo.ntslgcf"
                              type="number"
                              @input="countMoney"
                              suffix
                              min="0"
                              placeholder="请输入"
                            ></el-input>
                            <span class="inputEndText">万元</span>
                          </el-form-item>
                        </div>
                      </div>
                    </el-col>
                  </el-row>
                  <el-row>
                    <el-col :span="8">
                      <div class="boxItem_content_title">
                        <p>田间道路工程费：</p>
                        <div class="boxItem_content_row_item_input">
                          <el-form-item prop="tjdlgcf">
                            <el-input
                              v-model="submitInfo.tjdlgcf"
                              type="number"
                              @input="countMoney"
                              suffix
                              min="0"
                              placeholder="请输入"
                            ></el-input>

                            <span class="inputEndText">万元</span>
                          </el-form-item>
                        </div>
                      </div>
                    </el-col>
                    <el-col :span="8">
                      <div class="boxItem_content_title">
                        <p>其它施工费：</p>
                        <div class="boxItem_content_row_item_input">
                          <el-form-item prop="qtsgf">
                            <el-input
                              v-model="submitInfo.qtsgf"
                              type="number"
                              @input="countMoney"
                              suffix
                              min="0"
                              placeholder="请输入"
                            ></el-input>

                            <span class="inputEndText">万元</span>
                          </el-form-item>
                        </div>
                      </div>
                    </el-col>
                  </el-row>
                </el-col>
              </el-row>

              <el-row :gutter="20">
                <el-col :span="2">
                  <p class="freeTitle">其他费用</p>
                </el-col>
                <el-col :span="22">
                  <el-row>
                    <el-col :span="8">
                      <div class="boxItem_content_title">
                        <p>前期工作费：</p>
                        <div class="boxItem_content_row_item_input">
                          <el-form-item prop="qqgzf">
                            <el-input
                              v-model="submitInfo.qqgzf"
                              type="number"
                              @input="countMoney"
                              suffix
                              min="0"
                              placeholder="请输入"
                            ></el-input>

                            <span class="inputEndText">万元</span>
                          </el-form-item>
                        </div>
                      </div>
                    </el-col>
                    <el-col :span="8">
                      <div class="boxItem_content_title">
                        <p>工程监理费：</p>
                        <div class="boxItem_content_row_item_input">
                          <el-form-item prop="gcjlf">
                            <el-input
                              v-model="submitInfo.gcjlf"
                              type="number"
                              @input="countMoney"
                              suffix
                              min="0"
                              placeholder="请输入"
                            ></el-input>

                            <span class="inputEndText">万元</span>
                          </el-form-item>
                        </div>
                      </div>
                    </el-col>
                    <el-col :span="8">
                      <div class="boxItem_content_title">
                        <p>设备购置费：</p>
                        <div class="boxItem_content_row_item_input">
                          <el-form-item prop="sbgzf">
                            <el-input
                              v-model="submitInfo.sbgzf"
                              type="number"
                              @input="countMoney"
                              suffix
                              min="0"
                              placeholder="请输入"
                            ></el-input>
                            <span class="inputEndText">万元</span>
                          </el-form-item>
                        </div>
                      </div>
                    </el-col>
                  </el-row>
                  <el-row>
                    <el-col :span="8">
                      <div class="boxItem_content_title">
                        <p>竣工验收费：</p>
                        <div class="boxItem_content_row_item_input">
                          <el-form-item prop="jgysf">
                            <el-input
                              v-model="submitInfo.jgysf"
                              type="number"
                              @input="countMoney"
                              suffix
                              min="0"
                              placeholder="请输入"
                            ></el-input>

                            <span class="inputEndText">万元</span>
                          </el-form-item>
                        </div>
                      </div>
                    </el-col>
                    <el-col :span="8">
                      <div class="boxItem_content_title">
                        <p>业主管理费：</p>
                        <div class="boxItem_content_row_item_input">
                          <el-form-item prop="yzglf">
                            <el-input
                              v-model="submitInfo.yzglf"
                              type="number"
                              @input="countMoney"
                              suffix
                              min="0"
                              placeholder="请输入"
                            ></el-input>

                            <span class="inputEndText">万元</span>
                          </el-form-item>
                        </div>
                      </div>
                    </el-col>
                    <el-col :span="8">
                      <div class="boxItem_content_title">
                        <p>安全配套费：</p>
                        <div class="boxItem_content_row_item_input">
                          <el-form-item prop="aqptf">
                            <el-input
                              v-model="submitInfo.aqptf"
                              type="number"
                              @input="countMoney"
                              suffix
                              min="0"
                              placeholder="请输入"
                            ></el-input>

                            <span class="inputEndText">万元</span>
                          </el-form-item>
                        </div>
                      </div>
                    </el-col>
                  </el-row>
                </el-col>
              </el-row>

              <el-row :gutter="20" class="boxItem_content_row marginBottom">
                <el-col :span="2">
                  <p class="freeTitle">不可预见费用</p>
                </el-col>
                <el-col :span="22">
                  <el-row :gutter="20">
                    <el-col :span="8">
                      <div class="boxItem_content_row_item_input">
                        <el-form-item prop="bkyjfy">
                          <el-input
                            v-model="submitInfo.bkyjfy"
                            type="number"
                            @input="countMoney"
                            suffix
                            min="0"
                            placeholder="请输入内容"
                          ></el-input>

                          <span class="inputEndText">万元</span>
                        </el-form-item>
                      </div>
                    </el-col>
                  </el-row>
                </el-col>
              </el-row>
              <el-row :gutter="20" class="boxItem_content_row">
                <el-col :span="2">
                  <p class="totalMoney">总投资</p>
                </el-col>
                <el-col :span="22">
                  <el-row :gutter="20">
                    <el-col :span="8">
                      <div class="boxItem_content_row_item_input">
                        <el-input :readonly="true" v-model="allMoney" suffix placeholder="请输入内容"></el-input>
                        <span class="inputEndText">万元</span>
                      </div>
                    </el-col>
                  </el-row>
                </el-col>
              </el-row>
            </div>
          </div>

          <div class="boxItem">
            <div class="boxItem_title">
              <span class="tit">审计信息</span>
            </div>
            <div class="boxItem_content" style="padding-top:35px;">
              <el-row :gutter="20">
                <el-col :span="8">
                  <div class="boxItem_content_title">
                    <p>工程造价审计单位</p>
                    <div class="boxItem_content_row_item_input">
                      <el-form-item prop="projectCostEnterprise">
                        <el-input
                          v-model="submitInfo.projectCostEnterprise"
                          suffix
                          placeholder="请输入"
                        ></el-input>
                      </el-form-item>
                    </div>
                  </div>
                </el-col>
                <el-col :span="8">
                  <div class="boxItem_content_title">
                    <p>财务审计单位：</p>
                    <div class="boxItem_content_row_item_input">
                      <el-form-item prop="financeEnterprise">
                        <el-input v-model="submitInfo.financeEnterprise" suffix placeholder="请输入"></el-input>
                      </el-form-item>
                    </div>
                  </div>
                </el-col>
              </el-row>
            </div>
          </div>
        </el-form>

        <div class="boxItem">
          <div class="boxItem_title">
            <span class="tit">上传附件</span>
          </div>
          <div class="boxItem_content" style="padding-top:35px;">
            <div class="boxItem_content_row">
              <div class="boxItem_content_row_item">
                <p>区县综合验收资料模板</p>
                <div class>
                  <el-button @click="download" type="primary">下载</el-button>
                </div>
              </div>
            </div>
            <div class="boxItem_content_row">
              <div class="boxItem_content_row_item">
                <p>区县综合验收资料</p>
                <div class="upLoadImg" v-if="isProgressShow">
                  <upload @beforeUpload="beforeUpload" @res="getRes" :accept="'.zip'" />
                </div>
              </div>
            </div>
            <div class="uploadResult">
              <div class="marginTop20">
                <div class="title">上传结果</div>
                <el-table :data="tableData" border style="width: 100%">
                  <el-table-column prop="fileName" label="附件名称"></el-table-column>
                  <el-table-column prop label="上传结果">
                    <template slot-scope="scope">
                      <span
                        :class="scope.row.fileFlag=='true'?'':'uploadQuestionsTitle'"
                      >{{scope.row.fileFlag=='true'?'上传成功':'上传失败'}}</span>
                    </template>
                  </el-table-column>
                </el-table>
              </div>
            </div>
            <div class="btn" v-if="isProgressShow">
              <el-button
                type="primary"
                :disabled="noUpload"
                @click="btnProgress"
                :loading="isLoading"
              >提交</el-button>
              <el-button>取消</el-button>
            </div>
          </div>
        </div>
      </el-tab-pane>
      <el-tab-pane label="复垦点权利人信息" name="second">
        <div class="boxItem border">
          <el-input
            v-model="searchValue"
            placeholder="请输入权力人姓名"
            @keyup.enter.native="btnSearch"
            class="border_input"
          ></el-input>
          <el-button type="primary" @click="btnSearch">查询</el-button>
        </div>
        <div class="boxItem boxItem1">
          <div class="boxItem_title">
            <span class="tit">竣工验收复垦点权利人信息</span>
          </div>
          <div class="boxItem_content" style="padding-top:35px;">
            <el-table
              :data="jungongList"
              :header-cell-style="{background:'#f9f9f9',color:'#606266',fontSize:'12px'}"
              border
              style="width: 100%"
            >
              <el-table-column prop="rllcrChangeCause" label="变更原因" min-width="150" align="center"></el-table-column>
              <el-table-column prop="landName" label="片块号" width="180" align="center"></el-table-column>
              <el-table-column prop="townName" label="所在乡镇" width="120" align="center"></el-table-column>
              <el-table-column prop="villageName" label="村/居委会" width="100" align="center"></el-table-column>
              <el-table-column prop="tfh" label="图幅号" width="120" align="center"></el-table-column>
              <el-table-column prop="tbh" label="图斑号" width="100" align="center"></el-table-column>
              <el-table-column prop="jsydfkmj" label="建设用地复垦面积" width="120" align="center"></el-table-column>
              <el-table-column prop="jsjsydmj" label="减少建设用地面积(㎡)" width="140" align="center"></el-table-column>
              <el-table-column prop="yjxznydmj" label="预计新增农用地面积合计(㎡)" width="180" align="center"></el-table-column>
              <el-table-column prop="xzgdmj" label="新增耕地面积(㎡)" width="120" align="center"></el-table-column>
              <el-table-column prop="xzldmj" label="增加林地面积(㎡)" width="120" align="center"></el-table-column>
              <el-table-column prop="zjydmj" label="增加园地面积(㎡)" width="120" align="center"></el-table-column>
              <el-table-column prop="xzqtnydmj" label="新增其他农用地面积(㎡)" width="150" align="center"></el-table-column>
              <el-table-column prop="qlr" label="权利人" width="100" align="center"></el-table-column>
              <el-table-column prop="idCard" label="身份证号" width="180" align="center"></el-table-column>
              <el-table-column prop="nfkzjdcq" label="拟复垦宅基地产权证号" width="150" align="center"></el-table-column>
              <el-table-column prop="nczjd" label="农村宅基地" width="100" align="center"></el-table-column>
              <el-table-column prop="zjdfs" label="农村宅基地附属" width="120" align="center"></el-table-column>
              <el-table-column prop="cyydfs" label="采用地附属" width="110" align="center"></el-table-column>
              <el-table-column prop="yjfy" label="预付费用（元）" width="110" align="center"></el-table-column>
              <el-table-column fixed="right" label="操作" width="320" align="center">
                <template slot-scope="scope">
                  <el-button size="small" @click="btnEdit(scope.row)">编辑</el-button>
                  <el-button
                    type="primary"
                    size="small"
                    @click="btn_seeImg(scope.row.laterMappingActivity)"
                  >查看图片</el-button>
                  <el-button size="small" @click="changeLnglat(scope.row)">地图定位</el-button>
                </template>
              </el-table-column>
            </el-table>
            <div style="margin:20px;text-align:center">
              <el-pagination
                @size-change="showSize1"
                @current-change="showPage1"
                :current-page="needInfo1.page"
                :page-sizes="[5, 10, 20, 30]"
                :page-size="needInfo1.size"
                layout="total, sizes, prev, pager, next, jumper"
                :total="totalPage1"
              ></el-pagination>
            </div>
          </div>
        </div>
        <div class="boxItem boxItem1">
          <div class="boxItem_title">
            <span class="tit">入库备案复垦点权利人信息</span>
          </div>
          <div class="boxItem_content" style="padding-top:35px;">
            <el-table
              :data="entryPeopleList"
              :header-cell-style="{background:'#f9f9f9',color:'#606266',fontSize:'12px'}"
              border
              style="width: 100%"
            >
              <el-table-column
                type="index"
                show-overflow-tooltip
                label="复垦点序号"
                width="120"
                align="center"
              ></el-table-column>
              <el-table-column prop="landName" label="片块号" width="180" align="center"></el-table-column>
              <el-table-column prop="townName" label="所在乡镇" width="120" align="center"></el-table-column>
              <el-table-column prop="villageName" label="村/居委会" width="100" align="center"></el-table-column>
              <el-table-column prop="tfh" label="图幅号" width="120" align="center"></el-table-column>
              <el-table-column prop="tbh" label="图斑号" width="100" align="center"></el-table-column>
              <el-table-column prop="jsydfkmj" label="建设用地复垦面积(㎡)" width="140" align="center"></el-table-column>
              <el-table-column prop="jsjsydmj" label="预计减少建设用地面积(㎡)" width="170" align="center"></el-table-column>
              <el-table-column prop="yjxznydmj" label="预计增加农用地面积合计(㎡)" width="180" align="center"></el-table-column>
              <el-table-column prop="xzgdmj" label="预计增加耕地面积(㎡)" width="160" align="center"></el-table-column>
              <el-table-column prop="xzldmj" label="预计增加林地面积(㎡)" width="160" align="center"></el-table-column>
              <el-table-column prop="zjydmj" label="预计增加园地面积(㎡)" width="160" align="center"></el-table-column>
              <el-table-column prop="xzqtnydmj" label="预计增加其他农用地面积(㎡)" width="180" align="center"></el-table-column>
              <el-table-column prop="qlr" label="权利人" width="100" align="center"></el-table-column>
              <el-table-column prop="idCard" label="身份证号" width="180" align="center"></el-table-column>
              <el-table-column prop="nfkzjdcq" label="拟复垦宅基地产权证号" width="150" align="center"></el-table-column>
              <el-table-column prop="nczjd" label="农村宅基地面积(㎡)" width="140" align="center"></el-table-column>
              <el-table-column prop="zjdfs" label="农村宅基地附属用地面积(㎡)" width="180" align="center"></el-table-column>
            </el-table>
            <div style="margin:20px;text-align:center">
              <el-pagination
                @size-change="showSize"
                @current-change="showPage"
                :current-page="needInfo.page"
                :page-sizes="[5, 10, 20, 30]"
                :page-size="needInfo.size"
                layout="total, sizes, prev, pager, next, jumper"
                :total="totalPage"
              ></el-pagination>
            </div>
          </div>
        </div>

        <div class="boxItem boxItem1">
          <div class="boxItem_title">
            <span class="tit">入库与竣工复垦点权利人信息对比</span>
          </div>
          <div class="boxItem_content" style="padding-top:35px;">
            <div>
              <el-table :data="compareInfo" border style="width: 100%">
                <el-table-column prop="srQLr" label="入库权利人"></el-table-column>
                <el-table-column prop="srIdCard" label="入库身份证号"></el-table-column>
                <el-table-column prop="lcQlr" label="竣工权利人"></el-table-column>
                <el-table-column prop="lcIdCard" label="竣工身份证号" width="180"></el-table-column>
                <el-table-column prop label="变化情况">
                  <template slot-scope="scope">
                    <span>{{scope.row.isChangeCause!=null?(scope.row.isChangeCause=='UN_CHANGE_CAUSE'?'无变化':(scope.row.isChangeCause=='IS_CHANGE_CAUSE'?'有变化':'')):''}}</span>
                  </template>
                </el-table-column>
                <el-table-column prop="rllcrChangeCause" label="变更原因"></el-table-column>
              </el-table>
            </div>
          </div>
        </div>
      </el-tab-pane>
    </el-tabs>

    <el-dialog :close-on-click-modal="false" title="编辑竣工验收复垦点权利人信息" :visible.sync="updateDialog" width="40%">
      <el-form :model="editInfo" :rules="rules" ref="editInfo" class="demo-ruleForm">
        <el-form-item label="片块号" :label-width="formLabelWidth" prop="landName">
          <el-input v-model="editInfo.landName" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="权利人" :label-width="formLabelWidth" prop="qlr">
          <el-input v-model="editInfo.qlr" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="身份证号" :label-width="formLabelWidth" prop="idCard">
          <el-input v-model="editInfo.idCard" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="预付费用" :label-width="formLabelWidth" prop="yffy">
          <el-input v-model="editInfo.yffy" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="变更原因" :label-width="formLabelWidth" prop="changeCause">
          <el-input
            v-model="editInfo.changeCause"
            type="textarea"
            :rows="3"
            resize="none"
            autocomplete="off"
          ></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="updateDialog = false">取 消</el-button>
        <el-button type="primary" @click="btnUpdate">确 定</el-button>
      </div>
    </el-dialog>

    <!-- 查看竣工图片 -->
    <el-dialog :close-on-click-modal="false" title="查看图片" :visible.sync="seeImgDialog" width="50%">
      <seeImg :imgArr="imgArr" :quanTu="panoramaImg" />
    </el-dialog>

    <!-- 地理定位 -->
    <el-dialog :close-on-click-modal="false" :title="titleLandName" :visible.sync="positionDialog">
      <!-- <tdMap class="mapBox_right" ref="tdMap" :pkList="list" :isShowControls="false" /> -->
      <tdMap
        style="height: 600px"
        :isShowControls="false"
        class="mapBox_right"
        ref="tdMap"
        :pkList="list"
      />
    </el-dialog>

    <!-- 上传结果 -->
    <el-dialog :close-on-click-modal="false" title="上传结果" :visible.sync="errorBoxFlag" :before-close="handleClose">
      <div class="showTableBox">
        <div class="piankuaixinxi">
          <div class="title">附件信息</div>
          <el-table height="250" :data="uploadResultData" border style="width: 100%">
            <el-table-column prop="fileName" label="附件名称"></el-table-column>
            <el-table-column label="状态">
              <template slot-scope="scope">
                {{scope.row.explain}}
                <!-- <span :class="'fileStatus':scope.row">{{scope.row.explain}} -->
                <!-- </span> -->
              </template>
            </el-table-column>
          </el-table>
        </div>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { upImg } from "@/api/upImg";
import upload from "@/components/upload";
import {
  saveBasicInfo,
  saveAgainBasicInfo,
  queryLandLaterMappingInfo,
  queryLandStoringRecordInfo,
  updateLandLaterMappingInfo,
  queryLandCompletingResult,
  queryCompletingResultFile,
  laterMappingConstantStoringRecord,
  completingResultCommit,
  queryCompletingResult
} from "@/api/quxianzongheYanshou";
import tdMap from "@/components/tdMap";

import seeImg from "@/components/seeImg";
export default {
  components: {
    upload,
    tdMap,
    seeImg
  },
  data() {
    return {
      errorBoxFlag: false, //上传文件有误弹框控制
      uploadResultData: [], //上传附件结果列表
      noUpload: false,
      activeName: "first",
      rulesSubmitInfo: {
        capital: [
          { required: true, message: "请输入筹措资金", trigger: "blur" }
        ],
        advancePaymentTotal: [
          { required: true, message: "请输入预付款总金额", trigger: "blur" }
        ],
        ccgcf: [
          { required: true, message: "请输入拆除工程费", trigger: "blur" }
        ],
        tdpzgcf: [
          { required: true, message: "请输入土地平整工程费", trigger: "blur" }
        ],
        ntslgcf: [
          { required: true, message: "请输入农田水利工程费", trigger: "blur" }
        ],
        tjdlgcf: [
          { required: true, message: "请输入田间道路工程费", trigger: "blur" }
        ],
        qtsgf: [
          { required: true, message: "请输入其它施工费", trigger: "blur" }
        ],
        qqgzf: [
          { required: true, message: "请输入前期工作费", trigger: "blur" }
        ],
        gcjlf: [
          { required: true, message: "请输入工程监理费", trigger: "blur" }
        ],
        sbgzf: [
          { required: true, message: "请输入设备购置费", trigger: "blur" }
        ],
        jgysf: [
          { required: true, message: "请输入竣工验收费", trigger: "blur" }
        ],
        yzglf: [
          { required: true, message: "请输入业主管理费", trigger: "blur" }
        ],
        aqptf: [
          { required: true, message: "请输入安全配套费", trigger: "blur" }
        ],
        bkyjfy: [
          { required: true, message: "请输入不可预见费用", trigger: "blur" }
        ],
        projectCostEnterprise: [
          { required: true, message: "请输入工程造价审计单位", trigger: "blur" }
        ],
        financeEnterprise: [
          { required: true, message: "请输入财务审计单位", trigger: "blur" }
        ]
      },
      submitInfo: {
        capital: "", //筹措资金
        advancePaymentTotal: "", //预付款总金额
        ccgcf: "", //拆除工程费
        tdpzgcf: "", //土地平整工程费
        ntslgcf: "", //农田水利工程费
        tjdlgcf: "", //田间道路工程费
        qtsgf: "", //其它施工费
        qqgzf: "", //前期工作费
        gcjlf: "", //工程监理费
        sbgzf: "", //设备购置费
        jgysf: "", //竣工验收费
        yzglf: "", //业主管理费
        aqptf: "", //安全配套费
        bkyjfy: "", //不可预见费用
        projectCostEnterprise: "", //工程造价审计单位
        financeEnterprise: "" //财务审计单位
      },
      gongcheng: "", //工程施工费
      elseMoney: "", //其他费用
      allMoney: "", //总投资
      uploadText1: "上传",
      fileData1: {
        fileName: "",
        fileUrl: "",
        id: ""
      },
      isFirst: true,
      needInfo: {
        page: 1,
        size: 5
      },
      entryPeopleList: [], //入库备案复垦点权利人信息
      totalPage: 0,
      jungongList: [], //竣工验收复垦点权利人信息
      needInfo1: {
        page: 1,
        size: 5
      },
      totalPage1: 0,

      updateDialog: false,
      formLabelWidth: "100px",

      rules: {
        landName: [
          { required: true, message: "请输入片块名", trigger: "blur" }
        ],
        qlr: [{ required: true, message: "请输入权利人", trigger: "blur" }],
        idCard: [
          { required: true, message: "请输入身份证号", trigger: "blur" }
        ],
        yffy: [{ required: true, message: "请输入预付费用", trigger: "blur" }],
        changeCause: [
          { required: true, message: "请输入变更原因", trigger: "blur" }
        ]
      },
      //编辑
      editInfo: {
        id: "",
        landName: "", //片块名
        landId: "", //片块id
        qlr: "", //权利人
        idCard: "", //身份证号
        yffy: "", //预付费用
        changeCause: "" //变更原因
      },
      searchValue: "", //查询值

      isLoading: false,

      seeImgDialog: false,
      imgArr: [], //图片数据
      quanImg: {
        filePath: "",
        fileName: "全景照"
      },
      panoramaImg: "",

      positionDialog: false, //地理定位弹框
      titleLandName: "",
      list: [],

      tableData: [], //上传文件结果数据
      isResult: false, //上传文件结果回显
      compareInfo: [], //对比信息
      isProgressShow: false
    };
  },
  created() {
    if (localStorage.getItem("router") == "COMPLETING_RESULT_SAVE") {
      this.isProgressShow = true;
    } else {
      this.isProgressShow = false;
      this.isResult = true;
      this.getShow();
    }
    if (localStorage.getItem("lookStatus") == 2) {
      this.isProgressShow = false;
      this.isResult = true;
      this.getShow();
    }
    this.getEntryPeople(); //查询入库备案复垦点权利人信息
    this.getJungong(); //竣工验收复垦点权利人信息
    this.getDuibi();
    this.getEntryResult();
  },
  methods: {
    getShow() {
      //数据回显
      let obj = {
        projectId: localStorage.getItem("projectId")
      };
      queryCompletingResult(obj).then(res => {
        this.submitInfo = {
          capital: res.data.capital, //筹措资金
          advancePaymentTotal: res.data.advancePaymentTotal, //预付款总金额
          ccgcf: res.data.ccgcf, //拆除工程费
          tdpzgcf: res.data.tdpzgcf, //土地平整工程费
          ntslgcf: res.data.ntslgcf, //农田水利工程费
          tjdlgcf: res.data.tjdlgcf, //田间道路工程费
          qtsgf: res.data.qtsgf, //其它施工费
          qqgzf: res.data.qqgzf, //前期工作费
          gcjlf: res.data.gcjlf, //工程监理费
          sbgzf: res.data.sbgzf, //设备购置费
          jgysf: res.data.jgysf, //竣工验收费
          yzglf: res.data.yzglf, //业主管理费
          aqptf: res.data.aqptf, //安全配套费
          bkyjfy: res.data.bkyjfy, //不可预见费用
          projectCostEnterprise: res.data.projectCostEnterprise, //工程造价审计单位
          financeEnterprise: res.data.financeEnterprise //财务审计单位
        };
        this.allMoney = res.data.totalInvestment;
      });
    },
    btnProgress() {
      this.$refs["submitInfo"].validate(valid => {
        if (valid) {
          let obj = {
            projectId: localStorage.getItem("projectId"),
            capital: this.submitInfo.capital,
            advancePaymentTotal: this.submitInfo.advancePaymentTotal,
            ccgcf: this.submitInfo.ccgcf,
            tdpzgcf: this.submitInfo.tdpzgcf,
            ntslgcf: this.submitInfo.ntslgcf,
            tjdlgcf: this.submitInfo.tjdlgcf,
            qtsgf: this.submitInfo.qtsgf,
            qqgzf: this.submitInfo.qqgzf,
            gcjlf: this.submitInfo.gcjlf,
            sbgzf: this.submitInfo.sbgzf,
            jgysf: this.submitInfo.jgysf,
            yzglf: this.submitInfo.yzglf,
            aqptf: this.submitInfo.aqptf,
            bkyjfy: this.submitInfo.bkyjfy,
            projectCostEnterprise: this.submitInfo.projectCostEnterprise,
            financeEnterprise: this.submitInfo.financeEnterprise
          };
          this.isLoading = true;
          completingResultCommit(obj)
            .then(res => {
              this.isLoading = false;
              if (res.code == 1000) {
                this.$alert("当前流程办理完成", "提示", {
                  confirmButtonText: "确定",
                  callback: action => {
                    this.$router.push({
                      path: "/xmss/ywdeal"
                    });
                    this.getShow();
                  }
                });
              }
            })
            .catch(() => {
              this.isLoading = false;
            });
        } else {
          this.$alert("还有未完善的信息")
            .then(_ => {})
            .catch(_ => {});
          return false;
        }
      });
    },
    getDuibi() {
      // 入库与竣工复垦点权利人信息对比信息
      let obj = {
        projectId: localStorage.getItem("projectId"),
        qlr: this.searchValue,
        page: this.needInfo1.page,
        size: this.needInfo1.size
      };
      laterMappingConstantStoringRecord(obj).then(res => {
        this.compareInfo = res.data;
      });
    },
    download() {
      var a = document.createElement("a");
      a.setAttribute(
        "href",
        this.$https +
          "/pc/file/result/template/download?achievement=R_T_Q_X_Z_H_Y_S_Z_L"
      );
      a.setAttribute("download", ""); // download属性
      a.click();
    },
    changeLnglat(row) {
      this.list = [];
      this.positionDialog = true;
      this.titleLandName = row.landName;
      this.$nextTick(() => {
        this.list.push(row);
      });
    },
    // 计算费用
    countMoney() {
      this.gongcheng =
        Number(this.submitInfo.ccgcf != "" ? this.submitInfo.ccgcf : 0) +
        Number(this.submitInfo.tdpzgcf != "" ? this.submitInfo.tdpzgcf : 0) +
        Number(this.submitInfo.ntslgcf != "" ? this.submitInfo.ntslgcf : 0) +
        Number(this.submitInfo.tjdlgcf != "" ? this.submitInfo.tjdlgcf : 0) +
        Number(this.submitInfo.qtsgf != "" ? this.submitInfo.qtsgf : 0);
      this.elseMoney =
        Number(this.submitInfo.qqgzf != "" ? this.submitInfo.qqgzf : 0) +
        Number(this.submitInfo.gcjlf != "" ? this.submitInfo.gcjlf : 0) +
        Number(this.submitInfo.sbgzf != "" ? this.submitInfo.sbgzf : 0) +
        Number(this.submitInfo.jgysf != "" ? this.submitInfo.jgysf : 0) +
        Number(this.submitInfo.yzglf != "" ? this.submitInfo.yzglf : 0) +
        Number(this.submitInfo.aqptf != "" ? this.submitInfo.aqptf : 0);

      this.allMoney =
        Number(this.gongcheng != "" ? this.gongcheng : 0) +
        Number(this.elseMoney != "" ? this.elseMoney : 0) +
        Number(this.submitInfo.bkyjfy != "" ? this.submitInfo.bkyjfy : 0);
    },
    btnUpdate() {
      this.$refs["editInfo"].validate(valid => {
        if (valid) {
          let obj = {
            landCompletingResultId: this.editInfo.id,
            landId: this.editInfo.landId,
            landName: this.editInfo.landName,
            qlr: this.editInfo.qlr,
            idCard: this.editInfo.idCard,
            advancePayment: this.editInfo.yffy,
            changeCause: this.editInfo.changeCause
          };
          updateLandLaterMappingInfo(obj).then(res => {
            if (res.code == 1000) {
              this.$message({
                message: "修改成功",
                type: "success"
              });
              this.updateDialog = false;
              this.getJungong();
              this.getDuibi();
            }
          });
        } else {
          return false;
        }
      });
    },

    btnEdit(row) {
      // 编辑
      this.updateDialog = true;

      this.editInfo = {
        id: row.id,
        landId: row.landId,
        landName: row.landName,
        qlr: row.qlr,
        idCard: row.idCard,
        yffy: row.yjfy,
        changeCause: row.rllcrChangeCause
      };
    },
    btnSearch() {
      this.getDuibi();
      //条件查询
      let obj = {
        projectId: localStorage.getItem("projectId"),
        page: this.needInfo1.page,
        size: this.needInfo1.size,
        qlr: this.searchValue
      };
      queryLandLaterMappingInfo(obj).then(res => {
        this.jungongList = res.data.rows;
        this.totalPage1 = res.data.total;
      });
      // queryLandCompletingResult(obj).then(res => {
      //   this.jungongList = res.data.rows;
      //   this.totalPage1 = res.data.total;
      // });
      let obj1 = {
        projectId: localStorage.getItem("projectId"),
        page: this.needInfo.page,
        size: this.needInfo.size,
        qlr: this.searchValue
      };
      queryLandStoringRecordInfo(obj1).then(res => {
        this.entryPeopleList = res.data.rows;
        this.totalPage = res.data.total;
      });
    },
    getJungong() {
      // 竣工验收复垦点权利人信息
      let obj = {
        projectId: localStorage.getItem("projectId"),
        page: this.needInfo1.page,
        size: this.needInfo1.size,
        qlr: this.searchValue
      };

      queryLandLaterMappingInfo(obj).then(res => {
        this.jungongList = res.data.rows;
        this.totalPage1 = res.data.total;
      });
    },
    getEntryPeople() {
      //查询入库备案复垦点权利人信息
      let obj = {
        projectId: localStorage.getItem("projectId"),
        page: this.needInfo.page,
        size: this.needInfo.size
      };
      queryLandStoringRecordInfo(obj).then(res => {
        this.entryPeopleList = res.data.rows;
        this.totalPage = res.data.total;
      });
    },
    showSize(val) {
      this.needInfo.size = val;
      this.getEntryPeople();
    },
    showPage(val) {
      this.needInfo.page = val;
      this.getEntryPeople();
    },
    showSize1(val) {
      this.needInfo1.size = val;
      this.getJungong();
    },
    showPage1(val) {
      this.needInfo1.page = val;
      this.getJungong();
    },
    handleClose() {
      this.errorBoxFlag = false;
    },
    btnSubmit() {
      let obj = {
        projectId: localStorage.getItem("projectId"),
        // capital: this.submitInfo.capital,
        // advancePaymentTotal: this.submitInfo.advancePaymentTotal,
        // ccgcf: this.submitInfo.ccgcf,
        // tdpzgcf: this.submitInfo.tdpzgcf,
        // ntslgcf: this.submitInfo.ntslgcf,
        // tjdlgcf: this.submitInfo.tjdlgcf,
        // qtsgf: this.submitInfo.qtsgf,
        // qqgzf: this.submitInfo.qqgzf,
        // gcjlf: this.submitInfo.gcjlf,
        // sbgzf: this.submitInfo.sbgzf,
        // jgysf: this.submitInfo.jgysf,
        // yzglf: this.submitInfo.yzglf,
        // aqptf: this.submitInfo.aqptf,
        // bkyjfy: this.submitInfo.bkyjfy,
        // projectCostEnterprise: this.submitInfo.projectCostEnterprise,
        // financeEnterprise: this.submitInfo.financeEnterprise,
        completingResultFileId: this.fileData1.id
      };
      this.isLoading = true;
      saveBasicInfo(obj)
        .then(res => {
          this.isLoading = false;
          //this.errorBoxFlag = true;
          // this.uploadResultData = res.data;
          this.getEntryResult();
          this.isResult = true;
          // this.getClear()
        })
        .catch(error => {
          this.isLoading = false;
        });
    },
    getEntryResult() {
      //上传结果回显
      let obj = {
        projectId: localStorage.getItem("projectId")
      };
      queryCompletingResultFile(obj).then(res => {
        this.tableData = res.data;
      });
    },
    beforeUpload() {
      this.noUpload = true;
    },
    //上传后
    getRes(res) {
      this.fileData1.fileName = res.data.fileName;
      this.fileData1.fileUrl = res.data.filePath;
      this.fileData1.id = res.data.id;
      this.noUpload = false;
      this.$message({
        message: "上传成功",
        type: "success"
      });
      this.$nextTick(() => {
        this.btnSubmit();
      });
    },
    btn_seeImg(row) {
      //查看图片
      this.imgArr = [];
      this.panoramaImg = "";
      this.seeImgDialog = true;
      if (row != null) {
        if (row.positionOneFilePath != null && row.positionOneFilePath != "") {
          this.imgArr.push({
            fileName: "方位照1",
            filePath: row.landPositionOneFilePath,
            id: 1
          });
        }
        if (row.positionTwoFilePath != null && row.positionTwoFilePath != "") {
          this.imgArr.push({
            fileName: "方位照2",
            filePath: row.positionTwoFilePath,
            id: 2
          });
        }
        if (
          row.positionThreeFilePath != null &&
          row.positionThreeFilePath != ""
        ) {
          this.imgArr.push({
            fileName: "方位照3",
            filePath: row.positionThreeFilePath,
            id: 3
          });
        }
        if (
          row.positionFourFilePath != null &&
          row.positionFourFilePath != ""
        ) {
          this.imgArr.push({
            fileName: "方位照4",
            filePath: row.positionFourFilePath,
            id: 4
          });
        }
        if (
          row.panoramagramFilePath != null &&
          row.panoramagramFilePath != ""
        ) {
          this.panoramaImg = row.panoramagramFilePath;
        }
      }
    },
    getClear() {
      //清空值
      this.submitInfo = {
        capital: "", //筹措资金
        advancePaymentTotal: "", //预付款总金额
        ccgcf: "", //拆除工程费
        tdpzgcf: "", //土地平整工程费
        ntslgcf: "", //农田水利工程费
        tjdlgcf: "", //田间道路工程费
        qtsgf: "", //其它施工费
        qqgzf: "", //前期工作费
        gcjlf: "", //工程监理费
        sbgzf: "", //设备购置费
        jgysf: "", //竣工验收费
        yzglf: "", //业主管理费
        aqptf: "", //安全配套费
        bkyjfy: "", //不可预见费用
        projectCostEnterprise: "", //工程造价审计单位
        financeEnterprise: "" //财务审计单位
      };
      this.fileData1 = {
        fileName: "",
        fileUrl: "",
        id: ""
      };
    }
  }
};
</script>
<style lang="scss" scoped>
/deep/ .el-form-item {
  margin: 0;
}
.border {
  border: 1px solid #efefef;
  padding: 30px;
}
.border_input {
  width: 180px;
  margin-right: 20px;
}
.btn {
  padding: 40px;
  border-top: none;
}
.money {
  font-size: 13px;
  color: #606266;
}
/* .projectMoney {
  padding-left: 150px;
} */
#earlyStageAchievementOpinion {
  padding: 30px;
  box-sizing: border-box;
}
#earlyStageAchievementOpinion .boxItem {
  width: 100%;
  background-color: #fff;
}
#earlyStageAchievementOpinion .boxItem_title {
  width: 100%;
  background: #f8f8f8;
  height: 50px;
  border: 1px solid #efefef;
  overflow: hidden;
  color: #333;
  font-size: 18px;
  font-weight: bold;
  text-indent: 20px;
  line-height: 50px;
}
#earlyStageAchievementOpinion .boxItem_content {
  width: 100%;
  border: 1px solid #ebebeb;
  border-top: none;
  padding: 30px;
  padding-top: 0;
  box-sizing: border-box;
}
#earlyStageAchievementOpinion .boxItem_content_row {
  display: flex;
  align-items: center;
}
#earlyStageAchievementOpinion .boxItem_content_row_item {
  display: flex;
  align-items: center;
}
#earlyStageAchievementOpinion .boxItem_content_row_item:nth-child(2n-1) {
  margin-right: 300px;
}
#earlyStageAchievementOpinion .boxItem_content_row_item p {
  font-size: 14px;
  line-height: 36px;
  width: 180px;
}
#earlyStageAchievementOpinion .boxItem1 .boxItem_content_row_item p {
  width: 180px;
}
#earlyStageAchievementOpinion .boxItem_content_row_item_noFlex {
  display: flex;
  width: 100%;
}
#earlyStageAchievementOpinion .boxItem_content_row_item_noFlex p {
  font-size: 14px;
  line-height: 36px;
  width: 140px;
}
#earlyStageAchievementOpinion .boxItem_content_row_item p:first-child {
  color: #444;
  font-weight: bold;
  width: 180px;
}
#earlyStageAchievementOpinion .boxItem_content_row_item p:last-child {
  color: #666;
}
#earlyStageAchievementOpinion .uploadDownLoadBox_item {
  margin: 20px 0;
}
#earlyStageAchievementOpinion .uploadDownLoadBox_item p {
  width: 140px;
}
#earlyStageAchievementOpinion .button_box {
  margin-top: 54px;
}
#earlyStageAchievementOpinion .button_box_item {
  margin-right: 10px;
}
#earlyStageAchievementOpinion .boxItem_content_row_item_input {
  position: relative;
}
#earlyStageAchievementOpinion
  .boxItem_content_row_item_input
  /deep/
  .el-input__inner {
  padding-right: 50px;
}
#earlyStageAchievementOpinion .boxItem_content_row_item_input span {
  position: absolute;
  right: 10px;
  top: 3px;
  height: 36px;
  line-height: 36px;
  z-index: 1;
  color: #999;
}
#earlyStageAchievementOpinion .table-doc-view {
  border-collapse: collapse;
}
#earlyStageAchievementOpinion .table-doc-view tr,
.table-doc-view td {
  border: 1px solid #ccc;
  padding: 10px 10px;
}
#earlyStageAchievementOpinion .table-doc-view tr,
.table-doc-view td {
  border: 1px solid #ccc;
  padding: 10px 10px;
}
#earlyStageAchievementOpinion .table-doc-view td {
  font-size: 14px;
  color: #444;
  min-height: 30px;
}
#earlyStageAchievementOpinion .table-doc-view .taoc-title {
  text-align: center;
  font-size: 18px;
  font-weight: bold;
}
#earlyStageAchievementOpinion .table-doc-view .taoc-center {
  text-align: center;
}
#earlyStageAchievementOpinion .boxItem_content_row_item_noFlex_textarea {
  width: 80%;
}
#earlyStageAchievementOpinion .shencharen {
  display: flex;
  margin-right: 102px;
  align-items: center;
}
#earlyStageAchievementOpinion .shencharen img {
  width: 105px;
  height: 59px;
}
#earlyStageAchievementOpinion .shencharenTime {
  display: flex;
  align-items: center;
}
#earlyStageAchievementOpinion .shencharenTime p {
  width: 80px;
}
#earlyStageAchievementOpinion .boxItem_content_row_shenhe {
  margin: 30px 0;
}
#earlyStageAchievementOpinion .tableBoxData_title {
  width: 100%;
  display: block;
  overflow: hidden;
  font-size: 20px;
  font-weight: bold;
  color: #444;
  text-align: center;
  margin-bottom: 10px;
}
.tableBoxData_mainData {
  width: 100%;
  display: flex;
  justify-content: center;
}
.tableBoxData_button_box {
  width: 100%;
  display: flex;
  justify-content: center;
}
.tableBoxData_button_box_item {
  margin: 0px 20px;
  margin-bottom: 20px;
  margin-top: 10px;
}
.noPiankuanList {
  width: 100%;
  box-sizing: border-box;
  padding-left: 50px;
  font-size: 20px;
  padding-top: 10px;
  text-align: center;
  color: #999;
}
#earlyStageAchievementOpinion >>> input::-webkit-outer-spin-button,
#earlyStageAchievementOpinion >>> input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}
#earlyStageAchievementOpinion >>> input[type="number"] {
  -moz-appearance: textfield;
}
.boxItem_content_row_item p:first-child {
  text-align: right;
  margin-right: 10px;
}
.seeImg {
  text-align: center;
  overflow: hidden;
}
.seeImg ul,
.seeImg li {
  list-style: none;
}
.seeImg li {
  float: left;
}
.seeImg li img {
  width: 400px;
  height: 400px;
  margin-right: 20px;
  margin-bottom: 20px;
}
.piankuaixinxi .title {
  width: 100%;
  height: 50px;
  text-align: center;
  font-size: 16px;
  line-height: 50px;
  border: 1px solid #ebeef5;
  border-bottom: none;
  border-top: none;
}

.piankuaixinxi .fileStatus {
  color: red;
}
.boxItem_content_title {
  margin-bottom: 20px;
}
.boxItem_content_title p {
  font-size: 14px;
  font-weight: bold;
  color: #606266;
}
.boxItem_content_row_item_input {
  width: 50%;
}

.freeTitle {
  font-size: 15px;
  font-weight: bold;
  color: #666;
}
.totalMoney {
  font-size: 16px;
  font-weight: bold;
  color: #333;
}
.marginBottom {
  margin-bottom: 20px;
}
.uploadResult {
  font-size: 14px;
  margin: 0 40px;
}
.uploadQuestionsTitle {
  color: #c40000;
}
.marginTop20 {
  margin-top: 15px;
}
.boxItem_content_row_item_input_input {
  width: 200px;
}
.pageStyle {
  text-align: center;
  margin: 20px;
}
.title {
  width: 100%;
  height: 50px;
  font-size: 16px;
  line-height: 50px;
  border-bottom: none;
  font-weight: bold;
  color: #666;
}
</style>
 